<div style="margin:0 auto;width:1000px">
    <div class="cart_title">
      <div class="cart_title_content">
    <strong>CẬP NHẬT ĐƠN HÀNG </strong> <strong>[ <a href="cart_admin.html">Quản lý đơn hàng</a> ]</strong>
    </div></div>
    <div class="cart_item_content"> 
    <table cellpadding="4" cellspacing="1" width="100%">
        <tr>
          <td colspan="4" align="left" bgcolor="#FFFFFF"><div style="font-weight:bold;padding:5px 18px;font-size:12px">THÔNG TIN KHÁCH HÀNG</div></td>
        </tr>
        <tr>
          <td colspan="4" align="left" bgcolor="#FFFFFF">{$msg}</td>
          </tr>
        <tr>
          <td align="right" valign="top" bgcolor="#FFFFFF"><strong>Tên đăng nhập:</strong></td>
          <td valign="top" bgcolor="#FFFFFF">{$user_name}</td>
          <td align="right" valign="top" bgcolor="#FFFFFF"><strong>User ID:</strong></td>
          <td valign="top" bgcolor="#FFFFFF">{$user_id}</td>
        </tr>
        <tr>
              <td width="17%" align="right" valign="top" bgcolor="#FFFFFF"><strong>Tên đầy đủ(*):</strong></td>
              <td width="32%" valign="top" bgcolor="#FFFFFF"><input name="customer_name" type="text" id="customer_name" value="{$customer_name}" size="50"/></td>
              <td width="9%" align="right" valign="top" bgcolor="#FFFFFF"><strong>Email(*):</strong></td>
              <td valign="top" bgcolor="#FFFFFF"><input name="customer_email" type="text" id="customer_email" value="{$customer_email}" size="50"/></td>
          </tr>
            <tr>
              <td align="right" valign="top" bgcolor="#FFFFFF"><strong>Diện thoại liên hệ(*):</strong></td>
              <td valign="top" bgcolor="#FFFFFF"><input name="customer_phone" type="text" id="customer_phone" value="{$customer_phone}" size="50"/></td>
              <td align="right" valign="top" bgcolor="#FFFFFF"><strong>Địa chỉ(*):</strong></td>
              <td valign="top" bgcolor="#FFFFFF"><textarea name="customer_address" style="width:99%" rows="4" id="customer_address">{$customer_address}</textarea></td>
          </tr>
            <tr>
              <td align="right" valign="top" bgcolor="#FFFFFF"><strong>Ghi chú của Khách:</strong></td>
              <td colspan="3" valign="top" bgcolor="#FFFFFF"><textarea name="customer_note"  style="width:99%" rows="4" id="customer_note">{$customer_note}</textarea></td>
            </tr>
            <tr>
              <td align="right" valign="top" bgcolor="#FFFFFF"><strong>Ghi chú:</strong></td>
              <td colspan="3" valign="top" bgcolor="#FFFFFF"><textarea name="note"  style="width:99%" rows="4" id="note">{$note}</textarea></td>
            </tr>
            <tr>
              <td align="right" valign="top" bgcolor="#FFFFFF">Trạng thái</td>
              <td colspan="3" valign="top" bgcolor="#FFFFFF"><select name="status" id="status">
                
                  {$status_option}
                
              </select></td>
            </tr>
            <tr>
                <td colspan="3" align="left" bgcolor="#FFFFFF"><input name="Reset2" type="reset" style="cursor:pointer;"  value="Nhập lại thông tin" onclick="jQuery('#cart_act').val('');"/></td>
              <td align="left" bgcolor="#FFFFFF"><input name="submit" type="submit" style="cursor:pointer;" value="Cập nhật Đơn hàng" /></td>
          </tr>
        </table>
    </div>
    
    <div class="cart_title"><div class="cart_title_content">
    <strong>CHI TIẾT ĐƠN HÀNG [ <a href="cart_admin.html">Quản lý đơn hàng</a> ]</strong>
    </div></div>
    <div class="cart_item_content"> 
    	<table width="100%" cellspacing="1" cellpadding="5"  bgcolor="#cccccc">
            <tr>
              <td colspan="2" align="right" bgcolor="#FFFFFF" style="font-size:12px;padding:10px"><strong>Mã đơn hàng:</strong></td>
              <td width="82%" colspan="4" bgcolor="#FFFFFF" style="font-size:12px;padding:10px"><font color="#CC0000"><b>{$cart_id}</b></font></td>
            </tr><tr>
              <td colspan="2" align="right" bgcolor="#FFFFFF" style="font-size:12px;padding:10px"><strong>Tạo:</strong></td>
              <td colspan="4" bgcolor="#FFFFFF" style="font-size:12px;padding:10px">{$time_create}</td>
            </tr>
            <tr>
              <td colspan="2" align="right" bgcolor="#FFFFFF" style="font-size:12px;padding:10px"><strong>Cập nhật:</strong></td>
              <td colspan="4" bgcolor="#FFFFFF" style="font-size:12px;padding:10px">{$time_change}</td>
            </tr>
            <tr>
              <td colspan="2" align="right" bgcolor="#FFFFFF" style="font-size:12px;padding:10px"><strong>Gửi hóa hóa đơn:</strong></td>
              <td colspan="4" bgcolor="#FFFFFF" style="font-size:12px;padding:10px">{$time_finish}</td>
            </tr>
        </table>
        {if $cart_items}
        <table width="100%" cellspacing="1" cellpadding="5"  bgcolor="#cccccc" border="0">
            <tr>
                <td align="center" bgcolor="#F3F3F3"><strong>STT</strong></td>
                <td align="center" bgcolor="#F3F3F3"><strong>Ảnh</strong></td>
                <td width="37%" bgcolor="#F3F3F3"><strong>Sản phẩm</strong></td>
                <td width="13%" align="right" bgcolor="#F3F3F3"><strong>Đơn giá</strong></td>
                <td width="5%" align="center" bgcolor="#F3F3F3"><strong>Số lượng</strong></td>
              <td width="9%" align="center" bgcolor="#F3F3F3">
                <input type="checkbox" onclick="cart_check_all()" title="Chọn tất cả" id="chkAll" name="chkAll"  style="height:26px;width:26px">
              </td>
                <td width="11%" bgcolor="#F3F3F3"><strong>Thành tiền</strong></td>
              <td width="10%" align="center" bgcolor="#F3F3F3"></td>
          </tr>
            {assign var="stt" value="0"}
            {foreach from=$cart_items item=item name=cart_item}
            {assign var="stt" value=$stt+1}
            <tr  bgcolor="#Ffffff">
              <td width="4%" align="center">
                {$stt}
              </td>
                <td width="10%" align="center">
                    {if $item.img_url} 
                        <a href="{$item.url}"><img src="{$item.img_url}" width="120" height="120"/></a>
                    {/if}
                </td>
                <td ><a href="{$item.url}" {$onmouseover} >{$item.name}</a></td>
                <td align="right" nowrap="nowrap" bgcolor="#Ffffff">
                    <font color="#CC0000"><strong>{$item.price} VNĐ</strong></font>
                    <input name="price_item[{$item.id}]" type="hidden" id="price_item{$item.id}" value="{$item.price_num}"/>
                </td>
                <td align="center" bgcolor="#Ffffff">
                    <input name="quantity[{$item.id}]" type="text" id="quantity_{$item.id}" value="{$item.quantity}" size="5" class="tAC p3 bold" onchange="cart_change_quantity({$item.id});" />
                </td>
                <td align="center" bgcolor="#Ffffff">
                    <input type="checkbox" {if $item.checked}checked="checked"{/if} name="checked[{$item.id}]" onclick="cart_check({$item.id});" class="cart_item_cb" title="Chọn thanh toán" id="cart_item_{$item.id}" value="1" style="height:26px;width:26px" lang="{$item.id}"/>
                </td>
                <td nowrap="nowrap" bgcolor="#Ffffff"><font color="#CC0000"><b id="item_price_{$item.id}">{$item.row_total}</b></font></td>
                <td width="10%" align="center" nowrap="nowrap" bgcolor="#Ffffff">
                    <a href="{$item.delete}" onclick="return confirm('Bạn có chắc chắn muốn xóa bỏ sản phẩm này trong giỏ hàng không?');" style="color:#F00" title="Loại sản phẩm khỏi giỏ hàng"><img src="style/img/cart/cart_del.png" alt="[ Xóa ]"/></a>
                </td>
            </tr> 
            {/foreach}
            <tr>
                <td colspan="4" align="right" bgcolor="#fff"><strong>Tổng số:</strong></td>
                <td colspan="2" align="center" bgcolor="#fff"><b><span id="quantity_total">{$quantity_total}</span> sản phẩm</b></td>
                <td colspan="2" bgcolor="#fff"><font color="#CC0000"><b id="price_total">{$price_total}</b></font> <font color="#CC0000"><b>VNĐ</b></font></td>
            </tr>
            <tr>
              <td colspan="6" align="right" bgcolor="#fff"><input type="submit" name="submit" value="Cập nhật Giỏ hàng" onclick="jQuery('#cart_act').val('');" class="btn_hover"/></td>
              <td colspan="2" align="right" bgcolor="#fff"><input type="hidden" id="cart_act" name="cart_act" value=""/>
              <input type="submit"  name="submit2" value="Thanh toán đơn hàng »" onclick="jQuery('#cart_act').val('finish');" class="btn_hover"/></td>
            </tr>
      </table>
        {literal}
      <script>
                var cart_price 			= 0;
                var cart_quantity 		= 0;
                var cart_quantity_ar	= [];
                
                jQuery(document).ready(function(){				
                    var cart_check_all = true;
                    
                    jQuery(".cart_item_cb").each(function(){
                        cart_quantity_ar[this.lang] = parseInt( jQuery('#quantity_' + this.lang).val() );
                        
                        if(jQuery(this).is(':checked'))
                        {
                            cart_price 		+= parseInt( cart_quantity_ar[this.lang] ) * parseInt(	jQuery('#price_item' + this.lang).val()	);
                            
                            cart_quantity 	+= parseInt( cart_quantity_ar[this.lang] );
                        }
                        else					
                        {
                            cart_check_all = false;
                        }
                    });
                    
                    jQuery("#chkAll").attr('checked', cart_check_all);
                    
                    jQuery("#CartForm").submit(function(){//return true;	
                        return cart_check_items();	
                    });
                });
            </script>
        {/literal}
        {else}
            <div align="center" style="font-size:15px;color:#f00;padding:20px">Hiện chưa có sản phẩm nào trong giỏ hàng!</div>
        {/if}
    </div>
</div>